package com.xaaef.k8sdemo.consumer;

import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * </p>
 *
 * @author WangChenChen
 * @version 1.1
 * @date 2023/5/4 15:21
 */

@RequestMapping
@RestController
@AllArgsConstructor
public class IndexController {

    private final FeignProviderService feignProviderService;

    private final RestProviderService restProviderService;

    @GetMapping("/feign/hello")
    public String hello(@RequestParam("name") String name) {
        return feignProviderService.hello(name);
    }

    @GetMapping("/rest/hello")
    public String test(@RequestParam("name") String name) {
        return restProviderService.hello(name);
    }

}
